Current Location: Home> Function Categories> srand

srand

Sow the random number generator seeds
Name:srand
Category:math
Programming Language:php
One-line Description:Sow the random number generator seeds.

Definition and usage

srand() function sows the random number generator seed.

Example

In this example, we will seed the random number generator:

 <?php
srand ( mktime ( ) ) ;
echo ( rand ( ) ) ;
?>

Try it yourself

grammar

 srand ( seed )
parameter describe
seed Optional. Use seed to sow the random number generator seeds.

illustrate

Starting from PHP version 4.2.0, the seed parameter becomes optional, and when this item is empty, it will be set to any time.

Similar Functions
  • Anyway atan

    atan

    Anyway
  • Find the minimum value min

    min

    Findtheminimumvalue
  • Generate better random numbers mt_rand

    mt_rand

    Generatebetterrandom
  • Convert decimal to hexadecimal dechex

    dechex

    Convertdecimaltohexa
  • Hyperbolic sine sinh

    sinh

    Hyperbolicsine
  • Round the division result intdiv

    intdiv

    Roundthedivisionresu
  • Calculate the index of e exp

    exp

    Calculatetheindexofe
  • Convert hexadecimal to decimal hexdec

    hexdec

    Converthexadecimalto
Popular Articles